import request from "@/utils/request.js";
// 获取房产列表
export function getBuildingList(params) {
  return request({
    url: '/properties',
    method:'get',
    params
  })
}

// 获取房产总数
export function getBuildingCount() {
  return request({
    url: '/properties/count'
  })
}

// 获取房产详情
export function getBuildingDetailById(id) {
  return request({
    url: `/properties/${id}`
  })
}

// 新增房产
export function addBuilding(data) {
  return request({
    url: '/properties',
    method: 'post',
    data
  })
}

// 编辑房产
export function editBuilding(data) {
  return request({
    url: `/properties/${data.id}`,
    method: 'put',
    data
  })
}

// 删除房产
export function delBuilding(data) {
  return request({
    url: `/properties/${data.id}`,
    method: 'delete',
    data
  })
}
